<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>搜索</title>
	<meta name="viewport"
		content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<link rel="stylesheet" href="./css/reset.css">
	<link rel="stylesheet" href="./css/search.css">
</head>

<body>
	<header>
		<img class="arrow-left" src="./img/address/arrow.png" onclick="history.back()" alt="">
		<span class="title">搜索</span>
	</header>
	<div class="search-section">
		<form class="search-box" action="">
			<div><input type="text" placeholder="马卡龙色 多功能早餐机" class="searchbox"><button class="submit"
					type="button"><img src="./img/search/searchlogo.png" alt=""></button></div>
		</form>
		<div class="hot_search">热门搜索</div>
		<ul class="hot_search_items">
			<li><a href='./search_result.html?keyword=羽绒服'>羽绒服</a></li>
			<li><a href='./search_result.html?keyword=餐具'>餐具</a></li>
			<li><a href='./search_result.html?keyword=手表'>手表</a></li>
			<li><a href='./search_result.html?keyword=连衣裙'>连衣裙</a></li>
			<li><a href='./search_result.html?keyword=阔腿裤'>阔腿裤</a></li>
			<li><a href='./search_result.html?keyword=手表'>手表</a></li>
			<li><a href='./search_result.html?keyword=笔记本'>笔记本</a></li>
			<li><a href='./search_result.html?keyword=阔腿裤'>阔腿裤</a></li>
			<li><a href='./search_result.html?keyword=羽绒服'>羽绒服</a></li>
			<li><a href='./search_result.html?keyword=取暖电器'>取暖电器</a></li>
			<li><a href='./search_result.html?keyword=四件套'>四件套</a></li>
			<li><a href='./search_result.html?keyword=取暖电器'>取暖电器</a></li>
			<li><a href='./search_result.html?keyword=四件套'>四件套</a></li>
			<li><a href='./search_result.html?keyword=餐具'>餐具</a></li>
			<li><a href='./search_result.html?keyword=手表'>手表</a></li>
			<li><a href='./search_result.html?keyword=阔腿裤'>阔腿裤</a></li>
			<li><a href='./search_result.html?keyword=餐具'>餐具</a></li>
		</ul>
	</div>
	<script src="./js/axios.min.js"></script>
	<script src="./js/axios.config.js"></script>
	<script src="./js/utils.js"></script>
	<script>
		var oSearch = document.querySelector('.searchbox');
		var oSubmit = document.querySelector('.submit');
		oSubmit.onclick = function () {
			var oValue = oSearch.value;
			// console.log(oValue);
			axios.get('/seller/goods/list', { params: { keyword: oValue } })
				.then(function (res) {
					if (res.status) {
						location.assign(`./search_result.html?keyword=${oValue}`);
					}
				})
		}

	</script>
</body>

</html>